package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author deng
 * @package com.itheima.health.dao
 * @date Created in 2024/7/14 16:43
 */
public interface OrderSettingDao {
    @Select("select * from t_ordersetting where orderDate = #{orderDate}")
    OrderSetting findByOrderDate(Date orderDate);

    @Update("update t_ordersetting set reservations = #{reservations} where orderDate = #{orderDate}")
    void updateReservationsByOrderDate(OrderSetting orderSetting);
    @Insert("insert into t_ordersetting values (null, #{orderDate}, #{number}, #{reservations});")
    void add(OrderSetting orderSetting);
    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate};")
    void update(OrderSetting orderSetting);
    @Select("select * from t_ordersetting where orderDate between #{begin} and #{end};")
    List<OrderSetting> getByDate(Date begin, Date end);
}
